import { ref, computed } from 'vue';

export const useLoading = props => {
  const defaultLoading = ref(false);

  /**
   * @description loading控制
   * @return {Boolean} true | false
   */
  const getLoading = computed(() => {
    return props.loading || defaultLoading.value;
  });

  return {
    getLoading,
  };
};
